#include "manage_login.h"
#include "ui_manage_login.h"

manage_Login::manage_Login(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::manage_Login),
    newmanage(new manage_face)
{
    ui->setupUi(this);

    setWindowIcon(QIcon(":/img/icon.jpg"));

    setWindowTitle("天天考试系统");

    connect(newmanage, &manage_face::close, this, &manage_Login::manageFaceClose);
}

/* 注册界面关闭事件 */
void manage_Login::closeEvent(QCloseEvent *event)
{
    ui->le_uesr->clear();
    ui->le_password->clear();
    emit close();
}

void manage_Login::on_sureBtn_clicked()
{
    if (ui->le_uesr->text() == "1" && ui->le_password->text() == "1")
    {
        newmanage->show();
        this->hide();
        ui->le_uesr->clear();
        ui->le_password->clear();
    }
}

void manage_Login::on_cancelBtn_clicked()
{
    ui->le_uesr->clear();
    ui->le_password->clear();
    emit close();
}

/* 管理员页面关闭 */
void manage_Login::manageFaceClose()
{
    newmanage->hide();
    this->show();
}

manage_Login::~manage_Login()
{
    delete ui;
}
